# -*- coding: utf-8 -*-
# @Time    : 18-8-4 下午12:36
# @Author  : hp
# @Email   : shaoeric@foxmail.com

import requests
import json

def getWeather():
    url = "https://www.sojson.com/open/api/weather/json.shtml?city=吉林"
    response = requests.get(url=url).text
    response = json.loads(response)
    # 明天天气
    response = response['data']['forecast'][1]
    response = "明天{}，无锡天气{}，{}～{}，\n空气质量{}，风力{}，\n{}".format(response['date'], response['type'], response['low'], response['high'], response['aqi'], response['fl'].replace('<', ''), response['notice'])
    return response


if __name__ == '__main__':
    print(getWeather())
